package com.suray.wcs.service.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import com.suray.basic.wcs.utils.IBaseEnum;

public enum RoadType implements IBaseEnum<String> {
    S("S", "单开口巷道"),
    D("D", "双开口巷道");

    @EnumValue
    private String code;
    @JsonValue
    private String description;

    private RoadType(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public static RoadType getByCode(String code) {
        RoadType[] singleRuleDirectionEnums = RoadType.values();
        for (RoadType item : singleRuleDirectionEnums) {
            if (item.code.equals(code)) {
                return item;
            }
        }
        return null;
    }

    @Override
    public String getDescription() {
        return description;
    }

    @Override
    public String getVal() {
        return code;
    }

    @Override
    public String getValue() {
        return code;
    }
}
